#pragma once
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")

#include <d3d9.h>
#include <d3dx9.h>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <windows.h> 
#include <sstream>

class PD3DDevice
{
private:

	LPDIRECT3D9 direct3D;
	LPDIRECT3DDEVICE9 device;
	D3DPRESENT_PARAMETERS Parameters;

public:
	PD3DDevice(HWND hWnd,D3DPRESENT_PARAMETERS newParameters);
    PD3DDevice(HWND hWnd);
	~PD3DDevice(void);
	LPDIRECT3DDEVICE9 GetDevice();
	VOID PD3DDevice::Reset();
	HRESULT PD3DDevice::BeginScene();
	HRESULT PD3DDevice::EndScene();
	HRESULT PD3DDevice::Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
	void PD3DDevice::SetTransformMatrix(LPDIRECT3DDEVICE9 device, float screenWidth ,float screenHeight);
	void PD3DDevice::SetRenderStateMode(LPDIRECT3DDEVICE9 device, D3DXCOLOR ambientCollor, DWORD CULLMODE, bool light, DWORD ZENABLE);
	void PD3DDevice::SetSampleStateMode(LPDIRECT3DDEVICE9 device, int numSamples, DWORD typeFilter);
	void PD3DDevice::SetMaterial(LPDIRECT3DDEVICE9 device, float diffuse, float ambient);
	void PD3DDevice::Clear();
	void PD3DDevice::SetTransformMatrix(D3DXMATRIX matView);
};

